import {Component} from "@angular/core";
import {FaqItem} from "./entity/faqitem";
import {FaqService} from "./service/faq.service";
/**
 * Created by robin on 2016/8/5 0005.
 */
@Component({selector:"my-body",
            templateUrl:"./app/mainBody.html",
            providers:[FaqService]})
export class BodyComponent{
    private faqs:FaqItem[];//所有faq

    /**
     * 获取json数据并解析
     * @param faqService
     */
    constructor(faqService:FaqService) {
        faqService.getAllFaq().subscribe(result=>this.faqs=result.json());
        
    }
}